<%@ include file="/WEB-INF/view/include.jsp"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>

<spring:hasBindErrors
	name="EntryPermitAppDataMOdel">
			<script type="text/javascript">
			$(document).ready(
					function() {
						jAlert('error', '<li><div style="color:red;"><spring:message code="${errors.allErrors[0].code}" text="${errors.allErrors[0].defaultMessage}"/></div></li>',
								'<spring:message code="label.errormessage" />');
					});
			</script>
 </spring:hasBindErrors>

<form id="EPPaymentForm"  method="POST" action="client/company/ep/submitPayment.htm">
	 <div style="color: red;font-size: 15px;">
		<c:if test="${(EntryPermitAppDataMOdel.error)}">
			<li><spring:message code="fnp.inactive.msg" /></li>
		</c:if>
  	</div> 
	<fieldset>
	 	<legend><spring:message code="ep.fieldset" /></legend>
	</fieldset>
	
	<div class="t_form-left">
		 <label for="employeeName"><spring:message code="ep.empname" /></label>
		 <input type="text" disabled="disabled" id="employeeName" value="<c:out value='${EntryPermitAppDataMOdel.employeeName}'/>">
		 <label for="clietnReferenceNumber"><spring:message code="ep.clrefno" /></label>
		 <input type="text" disabled="disabled" id="clietnReferenceNumber" value="${EntryPermitAppDataMOdel.clietnReferenceNumber}">
		 
		 <label for="reservedAccBalance"><spring:message code="ep.resrbal" /></label>
		 <input type="text" disabled="disabled" id="reservedAccBalance" value="${EntryPermitAppDataMOdel.reservedAccBalance}">
		 
		 <label for="prepaidAccBalance"><spring:message code="ep.ppdbal" /></label>
		 <input type="text" disabled="disabled" id="prepaidAccBalance" value="${EntryPermitAppDataMOdel.prepaidAccBalance}">
		 
		 <label for="serviceName"><spring:message code="ep.servname" /></label>
		 <input type="text" disabled="disabled" id="serviceName" value="${EntryPermitAppDataMOdel.serviceName}">
		 
		 <label for="taskName"><spring:message code="ep.taskname" /></label>
		 <input type="text" disabled="disabled" id="taskName" value="${EntryPermitAppDataMOdel.taskName}">
	
	<label for="fnpServiceCode"><spring:message code="ep.selfnpcode" /></label>
	<select id="fnpServiceCode" name="fnpServiceCode">
		<c:forEach var="item" items="${EntryPermitAppDataMOdel.catalogVOs}">
			<option value="${item.id}">${item.descEng}</option>
		</c:forEach>
	</select>
	<input name="appId" type="hidden" id="appId" value="${EntryPermitAppDataMOdel.appId}">
	<c:if test="${!EntryPermitAppDataMOdel.error}"><button type="button" class="button_small" onclick="subm('EPPaymentForm');"><spring:message code="ep.preview" /></button></c:if>
	
	
	</div>
  	<div class="t_form-top">
  	
  	</div>
	<div id="submitFormDiv"></div>
</form>

<script type="text/javascript">
	function submitForm(divId){
		$('#EPPaymentForm').append($("#"+divId).html());
		var input = $("<input>").attr("type", "hidden").attr("name", "submitted").val("submitted");
		$('#EPPaymentForm').append($(input));
		$.fancybox.showLoading();
		blockPage();
		$('#EPPaymentForm').submit();
	}
</script>

